Magnetic sensor and method of manufacturing the same

ABSTRACT

A magnetic sensor that is easy to ensure the height of the yoke and that is also easy to guide magnetic flux in the direction in which the magnetic field sensing film detects a magnetic field is provided. The magnetic sensor includes first magnetic field detection element 21 that has first magnetic field sensing film 38 that detects a magnetic field in first direction X, and first yoke 23 that includes first portion 23a that is located on a side of first magnetic field sensing film 38 with respect to first direction X, and second portion 23b that is in contact with first portion 23a in direction Z that is orthogonal to first direction X. The average dimension of second portion 23b in first direction X is larger than the average dimension of first portion 23a in first direction X.

BACKGROUND OF THE INVENTION Field of the Invention

The present invention relates to a magnetic sensor and a method ofmanufacturing the same, and particularly to the configuration of a yokeof the magnetic sensor.

A magnetic sensor may be provided with a yoke near a magnetic fieldsensing film in order to guide magnetic flux in the magnetic fieldsensing direction of the magnetic field sensing film. JP2013-172040A,JP2015-94732A and WO 2011/68146 disclose a magnetic sensor in which ayoke is arranged near a magnetic field sensing film that detects amagnetic field in a first direction. The yoke extends in a seconddirection that is orthogonal to the first direction. The magnetic fluxemitted from an end portion of the yoke has a component in the firstdirection, and the magnetic field sensing film detects the component inthe first direction. A plurality of magnetic field sensing films isformed in the first direction, and the yokes and the magnetic fieldsensing films are alternately arranged.

WO 2015/170509 and JP7-210833 disclose a magnetic sensor in which an endportion of the yoke that is close to a magnetic field sensing film isformed in a tapered shape.

In order to guide magnetic flux in a first direction, it is desirablethat the end portion of a yoke be provided on a side of a magnetic fieldsensing film in the first direction. In order to reduce the size of amagnetic sensor, it is desirable to reduce as much as possible thearrangement space in the first direction for arranging the magneticfield sensing films and the end portions of the yokes that are adjacentto each other. On the other hand, in order to increase magnetic fluxdensity of the yoke, it is effective to increase the height of the yoke,or a dimension of the yoke in the second direction. The yoke is formedby means of plating in the wafer process. Therefore, plating needs to beformed in a narrow and deep hole on the side of the magnetic fieldsensing film. However, such a plating process is disadvantageous in termof ensuring the accuracy with which the plating is formed.

It is an object of the present invention to provide a magnetic sensorthat is easy to ensure the height of the yoke and that is also easy toguide magnetic flux in the direction in which the magnetic field sensingfilm detects a magnetic field.

SUMMARY OF THE INVENTION

A magnetic sensor of the present invention includes: a first magneticfield detection element that has a first magnetic field sensing filmthat detects a magnetic field in a first direction; and a first yokethat includes a first portion that is located on a side of the firstmagnetic field sensing film with respect to the first direction and asecond portion that is in contact with the first portion in a directionthat is orthogonal to the first direction. The average dimension of thesecond portion in the first direction is larger than the averagedimension of the first portion in the first direction.

According to the present invention, the first portion of the first yokeis located substantially on the side of the first magnetic field sensingfilm in the first direction. As a result, it is easy to guide magneticflux to the direction in which first magnetic field sensing film detectsthe magnetic field. The average dimension of the second portion in thefirst direction is larger than the average dimension of the firstportion in the first direction. Therefore, the hole of the resist inwhich the second portion is to be formed can be formed wide enough toensure the accuracy with which plating is formed. Accordingly, thepresent invention provides a magnetic sensor that is easy to ensure theheight of the yoke and that is also easy to guide magnetic flux in thedirection in which the magnetic field sensing film detects a magneticfield.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a partial cross sectional view illustrating a magnetic sensoraccording to a first embodiment of the present invention;

FIG. 2 are diagrams illustrating only yokes and magnetic field detectionelements in FIG. 1;

FIG. 3 is a schematic diagram illustrating the configuration of firstand second magnetic field detection elements;

FIGS. 4A to 8B are diagrams illustrating the manufacturing processes ofthe magnetic sensor in FIG. 1;

FIGS. 9A to 9C are results of simulating magnetic field in ComparativeExamples 1, 2 and Example, respectively; and

FIGS. 10A to 10C are partial enlarged views of FIGS. 9A to 9C,respectively.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

Hereinafter, some embodiments of the present invention will be describedwith reference to the drawings. FIG. 1 is a partial cross-sectional viewillustrating a magnetic sensor according to a first embodiment of thepresent invention. Magnetic sensor 1 has a plurality of magnetic fielddetection elements and a plurality of yokes. The yoke guides magneticflux in the magnetic field sensing direction of the magnetic fielddetection element, and the magnetic flux that is guided in the magneticfield sensing direction by the yoke is detected by the magnetic fielddetection element. The magnetic field detection elements areinterconnected by a bridge circuit (not illustrated) or the like, andthereby magnetic sensor 1 can measure external magnetic field. FIG. 1illustrates magnetic sensor 1 that includes first and second magneticfield detection elements 21, 22 that are adjacent to each other andfirst to third yokes 23, 24, 25 that are arranged near magnetic fielddetection elements 21, 22. FIG. 2 is a diagram illustrating only firstand second magnetic field detection elements 21, 22 and first to thirdyokes 23, 24, 25 in FIG. 1, for convenience of description.

In the following description, the first direction is a magnetic fieldsensing direction in which first and second magnetic field sensing films38, 42 detect a magnetic field. The first direction also corresponds tothe direction in which first magnetic field sensing film 38 and secondmagnetic field sensing film 42 are arranged. The second direction isorthogonal to the first direction. The second direction corresponds tothe direction in which upper lead 37 and lower lead 31 of first magneticfield detection element 21 are arranged. The second direction alsocorresponds to the direction in which upper lead 41 and lower lead 40 ofsecond magnetic field detection element 22 are arranged. The firstdirection is orthogonal to the film thickness direction of first andsecond magnetic field sensing films 38, 42, and the second direction isparallel to the film thickness direction of first and second magneticfield sensing films 38, 42. The third direction is orthogonal both tothe first direction and to the second direction. The first direction,the second direction and the third direction may be referred to asdirection X, direction Z and direction Y, respectively. Note that thatthe magnetic flux is assumed to flow from second and third yokes 24, 25to first yoke 23 in the present embodiment, but there is no differencein the configuration and effect of the present embodiment even when themagnetic flux flows from first yoke 23 to second and third yokes 24, 25.

Magnetic sensor 1 includes substrate 2, second and third yokes 24, 25that are formed on substrate 2 via first insulation layer 3, first andsecond magnetic field detection elements 21, 22 that are provided abovesecond and third yokes 24, 25, and first yoke 23 that is providedbetween first magnetic field detection element 21 and second magneticfield detection element 22 with regard to first direction X. First tothird yokes 23, 24, 25 are formed of a soft magnetic material, such asNiFe. First electrode films 4 that are formed in a plating step areprovided between first insulation layer 3 and second and third yokes 24,25.

First magnetic field detection element 21 includes first magnetic fieldsensing film 38 that detects a magnetic field in first direction X and apair of first leads 31, 37. First leads 31, 37 sandwich first magneticfield sensing film 38 in second direction Z and supply sense current tofirst magnetic field sensing film 38. Second magnetic field detectionelement 22 includes second magnetic field sensing film 42 that detects amagnetic field in first direction X and a pair of second leads 40, 41.Second leads 40, 41 sandwich second magnetic field sensing film 42 insecond direction Z and supply sense current to second magnetic fieldsensing film 42. The sense current flows in second direction Z.Hereinafter, the leads of the pairs of first and second leads on theside of substrate 2 are referred to as lower leads 31, 40, respectively,and the leads on the side opposite to lower leads 31, 40 with respect tofirst and second magnetic field sensing films 38, 42 are referred to asupper leads 37, 41, respectively. Second magnetic field detectionelement 22 is arranged away from first magnetic field detection element21 in first direction X. First magnetic field sensing film 38 and secondmagnetic field sensing film 42 are provided at symmetrical positionswith respect to the center line of first yoke 23 in direction Z.

First yoke 23 is provided between second yoke 24 and third yoke 25 withrespect to direction X and between first magnetic field sensing film 38and second magnetic field sensing film 42. More specifically, secondyoke 24 is located on the side opposite to first yoke 23 with respect tofirst magnetic field sensing film 38 and lies on an extended line ofstraight line L1 that connects center 23 c of first yoke 23 to center 38a of first magnetic field sensing film 38. Third yoke 25 is located onthe side opposite to first yoke 23 with respect to second magnetic fieldsensing film 42 and lies on an extended line of straight line L2 thatconnects center 23 c of first yoke 23 to center 42 a of second magneticfield sensing film 42. Centers 23 c, 38 a, 42 a are synonymous with thecenter of gravity. FIG. 1 schematically illustrates the flow of magneticflux that passes through first to third yokes 23, 24, 25. The magneticflux emitted from second and third yokes 24, 25 proceeds in the obliqueand upward direction in FIG. 1 and is absorbed in first yoke 23.Specifically, the magnetic flux that proceeds in second and third yokes24, 25 in direction Z changes its direction such that the direction hasdirection X component between second and third yokes 24, 25 and firstyoke 23 before being absorbed in first yoke 23, and then proceeds infirst yoke 23 in direction Z. First magnetic field sensing film 38 ispositioned in the area between first yoke 23 and second yoke 24 that haslarge direction X component of the magnetic flux, and therefore themagnetic flux in direction X can be efficiently detected. The sameapplies to second magnetic field sensing film 42.

Second insulation layer 5 is formed on the sides of second and thirdyokes 24, 25. Third insulation layer 7 is formed on the sides of lowerleads 31, 40. Fourth insulation layer 8 is formed on the sides of firstand second magnetic field sensing films 38, 42. Fifth insulation layer 9is formed on the sides of upper leads 37, 41. Sixth insulation layer 11is formed on the sides of second portion 23 b of first yoke 23 (laterdescribed). First intermediate insulation layer 6 is formed betweensecond and third yokes 24, 25 and lower leads 31, 40. Secondintermediate insulation layer 10 is formed between upper leads 37, 41and sixth insulation layer 11. First to sixth insulation layers 3, 5, 7,8, 9, 11, and first and second intermediate insulation layers 6, 10 areformed of Al₂O₃. Note that first intermediate insulation layer 6 is asupport layer that supports first and second magnetic field detectionelements 21, 22.

Next, first and second magnetic field detection elements 21, 22 will bedescribed. Since first magnetic field detection element 21 and secondmagnetic field detection element 22 have the same structure, only firstmagnetic field detection element 21 is described here. FIG. 3 is across-sectional view illustrating the configuration of first magneticfield detection element 21 in more detail. First magnetic field sensingfilm 38 of first magnetic field detection element 21 includesmagnetization free layer 35, magnetization fixed layer 33 and spacerlayer 34 that is sandwiched between magnetization free layer 35 andmagnetization fixed layer 33. Spacer layer 34 exhibits themagneto-resistive effect. Magnetization free layer 35 is formed of asoft magnetic material, such as NiFe. The magnetization direction ofmagnetization free layer 35 relative to external magnetic field rotatesin a plane that includes first direction X and third direction Y.Magnetization free layer 35 has a sufficiently larger length indirection Y than in direction X so that the magnetization direction isoriented in direction X due to the shape anisotropy effect. Bias layersthat are formed of a hard magnetic material may be provided on bothsides of magnetization free layer 35 with regard to direction X in orderto orient the magnetization direction in direction X. Magnetizationfixed layer 33 is formed of a soft magnetic material, such as CoFe, andthe magnetization direction is fixed relative to the external magneticfield. Spacer layer 34 is a tunnel barrier layer that is formed of anonmagnetic insulating material, such as Al₂O₃. Accordingly, firstmagnetic field detection element 21 of the present embodiment is a TMR(Tunnel Magneto Resistive) element, but may also be a so-called GMR(Giant Magneto Resistive) element in which spacer layer 34 is formed ofa nonmagnetic metal layer, such as Cu.

Magnetization fixed layer 33 is formed by stacking first magnetizationfixed layer 33 a, nonmagnetic intermediate layer 33 b and secondmagnetization fixed layer 33 c in this order. First magnetization fixedlayer 33 a is formed on seed layer 32 that is formed of Ta or Ru. Secondmagnetization fixed layer 33 c is in contact with spacer layer 34. Firstmagnetization fixed layer 33 a and second magnetization fixed layer 33 care formed of a soft magnetic material, such as CoFe, and nonmagneticintermediate layer 33 b is formed of Ru. First magnetization fixed layer33 a and second magnetization fixed layer 33 c areanti-ferromagnetically coupled through nonmagnetic intermediate layer 33b. An antiferromagnetic layer that is formed of IrMn or the like andthat is exchange-coupled to first magnetization fixed layer 33 a may beprovided under first magnetization fixed layer 33 a. Magnetization freelayer 35 is covered by protective layer 36 that is formed of Ta or thelike. Note that first magnetic field detection element 21 and secondmagnetic field detection element 22 are not limited to the TMR elementor the GMR element, and may be of any type of magnetic field detectionelements, such as an AMR (An-Isotropic Magneto Resistive) element, aslong as they can detect a magnetic field in first direction X.

First yoke 23 is partitioned into first portion 23 a and second portion23 b in direction Z. First portion 23 a is located substantially halfwaybetween first magnetic field sensing film 38 and second magnetic fieldsensing film 42. The term “substantially halfway” includes a first casewhere the center axis of first portion 23 a in direction Z is slightlyshifted in direction X from the middle point between the center of firstmagnetic field sensing film 38 and the center of second magnetic fieldsensing film 42 and a second case where first portion 23 a is slightlyshifted in direction Z with respect to the center of first magneticfield sensing film 38 and the center of second magnetic field sensingfilm 42. Second portion 23 b is formed farther away from first andsecond magnetic field sensing films 38, 42 than first portion 23 a withrespect to direction Z, and is in contact with first portion 23 a. Firstportion 23 a extends beyond first and second magnetic field sensingfilms 38, 42 in direction Z, when viewed from second portion 23 b. Inother words, end 23 d of first portion 23 a, which is on a side oppositeto second portion 23 b, faces second and third yokes 24, 25 in firstdirection X. End 23 e of first portion 23 a that is connected to secondportion 23 b is located on the side of second portion 23 b with regardto first and second magnetic field sensing films 38, 42, as seen indirection Z, and end 23 d of first portion 23 a is located on the sideopposite to second portion 23 b with regard to first and second magneticfield sensing films 38, 42, as seen in direction Z That is, firstportion 23 a passes through between first magnetic field sensing film 38and second magnetic field sensing film 42, and a part of first portion23 a extends beyond first and second magnetic field sensing films 38,42, as seen in direction Z from second portion 23 b. However, when themagnetic flux component in direction X is large enough, first portion 23a may terminate on the side of second portion 23 b with regard to firstmagnetic field sensing film 38 and second magnetic field sensing film42. Second electrode film 12 that is formed in the plating step isprovided on the outer periphery of first portion 23 a.

The dimension of first yoke 23 in direction X monotonically increasesfrom below to above in direction Z in FIG. 2, that is, in a directionaway from second and third yokes 24, 25 or substrate 2. Accordingly, theaverage dimension of second portion 23 b in direction X is larger thanthe average dimension of first portion 23 a in direction X. The averagedimension of first portion 23 a in direction X means the average valueof the dimension of first portion 23 a that is calculated in directionZ. In other words, the average dimension of first portion 23 a indirection X means X direction width W1 of virtual rectangle 23 f thathas the same area and the same dimension in direction Z as first portion23 a in FIG. 2. Similarly, the average dimension of second portion 23 bin direction X means the average value of the dimension of secondportion 23 b that is calculated in direction Z. In other words, theaverage dimension of second portion 23 b in direction X means Xdirection width W2 of virtual rectangle 23 g that has the same area andthe same dimension in direction Z as second portion 23 b in FIG. 2. Thedimension in direction X of either first portion 23 a or second portion23 b may be constant in direction Z, and the dimensions in direction Xof both first portion 23 a and second portion 23 b may be constant indirection Z. In other words, first portion 23 a may be the same as theshape of virtual rectangle 23 f, and second portion 23 b may be the sameas the shape of virtual rectangle 23 g.

The surfaces of first portion 23 a that face first and second magneticfield sensing films 38, 42 have curved surfaces 23 h, 23 h′ that arerecessed in a direction of retreating from first and second magneticfield sensing films 38, 42, respectively. The shape of the surfaces arenot limited to a curved shape and may be, for example, a planer shape.Curved surfaces 23 h, 23 h′ may only be provided on the side of firstmagnetic field sensing film 38 or on the side of second magnetic fieldsensing film 42.

Next, a method of manufacturing magnetic sensor 1 described above willbe described with reference to FIGS. 4A to 8B.

First, first insulation layer 3 is formed on substrate 2, as illustratedin FIG. 4A. Next, first electrode film 4 is formed on first insulationlayer 3, as illustrated in FIG. 4B. Then, first photoresist 43 is formedon first electrode film 4, and first holes 44 for forming second andthird yokes 24, 25 therein are formed by exposure and developmentprocesses, as illustrated in FIG. 4C. Next, second and third yokes 24,25 are formed in first holes 44 by means of plating, as illustrated inFIG. 4D.

Next, first photoresist 43 is ablated, as illustrated in FIG. 5A. Then,first electrode film 4 is removed by means of milling except forportions where first electrode film 4 is in contact with second andthird yokes 24, 2,5, as illustrated in FIG. 5B. Next, second insulationlayer 5 is formed, and second insulation layer 5 that is formed on topof second and third yokes 24, 25 is removed by CMP, as illustrated inFIG. 5C. As a result, the side spaces of second and third yokes 24, 25are filled with second insulation layer 5.

Then, first intermediate insulation layer 6 is formed by means ofsputtering on second insulation layer 5, as illustrated in FIG. 6A.Next, lower lead layers 31, 40 of first and second magnetic fielddetection elements 21, 22 are formed by means of sputtering on firstintermediate insulation layer 6 (support layer), and the side spaces oflower lead layers 31, 40 are filled with third insulation layer 7. Next,Magnetic field sensing films 38, 42 of first and second magnetic fielddetection elements 21, 22 are formed by means of sputtering on lowerlead layers 31, 40 of first and second magnetic field detection elements21, 22, and then the side spaces of magnetic field sensing films 38, 42are filled with fourth insulation layer 8. Then, upper lead layers 37,41 of first and second magnetic field detection elements 21, 22 areformed by means of sputtering on magnetic field sensing films 38, 42 offirst and second magnetic field detection elements 21, 22, and then theside spaces of upper lead layers 37, 41 are filled with fifth insulationlayer 9. Thereafter, second intermediate insulation layer 10 is formedby means of sputtering on upper lead layers 37, 41 of first and secondmagnetic field detection elements 21, 22 and on fifth insulation layer9. Next, second photoresist 45 is formed on second intermediateinsulation layer 10, and second hole 46 is formed by means of exposureand development processes just above where first portion 23 a of firstyoke 23 is to be formed, as illustrated in FIG. 6B.

Then, third hole 47 for forming first portion 23 a of first yoke 23 isformed by means of milling via second hole 46, and second photoresist 45is ablated, as illustrated in FIG. 7A. Next, second electrode film 12 isformed on the inner wall of third hole 47 and on second intermediateinsulation layer 10, as illustrated in FIG. 7B.

Then, third photoresist 48 is formed, and fourth hole 49 that isconnected to third hole 47 is formed by means of exposure anddevelopment processes at a portion where second portion 23 b of firstyoke 23 is to be formed, as illustrated in FIG. 8A. Next, first yoke 23is formed in third hole 47 and fourth hole 49 by means of plating, asillustrated in FIG. 8B. Then, third photoresist 48 is ablated, secondelectrode film 12 is removed, and sixth insulation layer 11 is formed onthe sides of second portion 23 b of first yoke 23, and the configurationillustrated in FIG. 1 is obtained.

FIGS. 9A to 9C show the results of simulating magnetic field inComparative Examples 1, 2 and Example, respectively. FIGS. 10A, to 10Cillustrate enlarged views near first and second magnetic field detectionelements 21, 22. FIGS. 10A to 10C illustrate the enlarged views of partA of FIG. 9A, part B of FIG. 9B, and part C of FIG. 9C, respectively.The white square in FIGS. 10A to 10C roughly indicates the position offirst magnetic field sensing film 38. FIG. 9A and FIG. 10A showsimulation results of Comparative Example 1 in which the lower end offirst yoke 123 is located above first magnetic field sensing film 38.The dimension of first yoke 123 in direction X is slightly smaller thanthe interval between first magnetic field detection element 21 andsecond magnetic field detection element 22 and is constant in directionZ. In the figure, the length of the arrow indicates the intensity of themagnetic flux, and the direction of the arrow indicates the direction ofthe magnetic flux. Since first magnetic field sensing film 38 detects amagnetic field of direction X, it is preferred that the arrow beinclined toward direction X as much as possible. FIG. 9B and FIG. 10Bshow simulation results of Comparative Example 2 in which the lower endof first yoke 223 is located below first magnetic field sensing film 38.As compared to Comparative Example 1, the magnetic flux is furtherinclined toward direction X at the position of first magnetic fieldsensing film 38. FIG. 9C and FIG. 10C show a simulation result ofExample in which the lower end of first yoke 23 is located below firstmagnetic field sensing film 38 and the surface of first yoke 23 thatfaces first magnetic field sensing film 38 is recessed. The magneticflux is slightly inclined toward direction Z as compared to ComparativeExample 2, but is inclined toward direction X as compared to ComparativeExample 1.

On the other hand, as described in the above description of themanufacturing method, when first yoke 23 is formed by means of plating,third hole 47 is formed on the sides of first and second magnetic fielddetection elements 21, 22 in advance, fourth hole 49 is formed in thirdphotoresist 48 in advance, and then first yoke 23 is formed in third andfourth holes 47, 49 by means of plating. Accordingly, in case ofComparative Example 2 in which first yoke 223 has a generally elongateshape, fourth hole 49 is also deep and elongate. However, it will bedifficult for the plating process to ensure an accurate shape for holesthat are deep and elongate, and this may cause a deterioration in theaccuracy with which first yoke 223 is formed. In Example, however, firstyoke 23 consists of first portion 23 a that has a small dimension indirection X and second portion 23 b that has a large dimension indirection X, and accordingly, the dimension of fourth hole 49 indirection X is larger than that of third hole 47, and therefore it iseasy to ensure that first yoke 23 is accurately formed.

Thus, a magnetic field sensor can be obtained in the present embodimentin which it is easy to ensure that first yoke 23 is accurately formedand in which magnetic flux is further inclined toward direction X at thepositions of first and second magnetic field sensing films 38, 42. Notethat magnetic sensor 1 in the above-described embodiment has a pluralityof magnetic field detection elements and a plurality of yokes, but inthe present invention, one magnetic field detection element and onefirst yoke 23 are the minimum components, and such a configuration isalso included in the present invention.

REFERENCE SIGNS LIST

-   1 Magnetic sensor-   21 First magnetic field detection element-   22 Second magnetic field detection element-   23 First yoke-   23 a First portion of the first yoke-   23 b Second portion of the first yoke-   24 Second yoke-   25 Third yoke-   31 Lower lead of the first magnetic field detection element-   33 Magnetization fixed layer-   34 Spacer layer-   35 Magnetization free layer-   37 Upper lead of the first magnetic field detection element-   38 First magnetic field sensing film-   40 Lower lead of the second magnetic field detection element-   41 Upper lead of the second magnetic field detection element-   42 Second magnetic field sensing film-   X First direction-   Z Second direction

What is claimed is:
 1. A magnetic sensor comprising: a first magneticfield detection element that has a first magnetic field sensing filmthat detects a magnetic field in a first direction; and a yoke thatincludes a first portion that is located on a side of the first magneticfield sensing film with respect to the first direction and a secondportion that is in contact with the first portion in a direction that isorthogonal to the first direction, wherein an average dimension of thesecond portion in the first direction is larger than an averagedimension of the first portion in the first direction, and the yoke ismade of a soft magnetic material.
 2. The magnetic sensor according toclaim 1, wherein a part of the first portion extends beyond the firstmagnetic field sensing film, when viewed from the second portion in thedirection that is orthogonal to the first direction.
 3. The magneticsensor according to claim 1, wherein the yoke is a first yoke, and themagnetic sensor further comprises a second yoke that is located on aside opposite to the first yoke with respect to the first magnetic fieldsensing film, and the second yoke lies on an extended line of a straightline that connects a center of the first yoke to a center of the firstmagnetic field sensing film.
 4. The magnetic sensor according to claim1, further comprising a second magnetic field detection element that hasa second magnetic field sensing film that detects a magnetic field inthe first direction, wherein the second magnetic field detection elementis located away from the first magnetic field detection element in thefirst direction, wherein the first portion is located substantiallyhalfway between the first magnetic field sensing film and the secondmagnetic field sensing film.
 5. The magnetic sensor according to claim4, further comprising a third yoke that is located on a side opposite tothe first yoke with respect to second magnetic field sensing film, thethird yoke lying on an extended line of a straight line that connects acenter of the first yoke to a center of the second magnetic fieldsensing film, wherein an end portion of the first portion on a sideopposite to the second portion faces the second and third yokes in thefirst direction.
 6. The magnetic sensor according to claim 1, wherein asurface of the first portion that faces the first magnetic field sensingfilm has a curved surface that is recessed in a direction of retreatingfrom the first magnetic field sensing film.
 7. The magnetic sensoraccording to claim 1, wherein the first magnetic field sensing filmincludes a magnetization free layer in which a magnetization directionrelative to external magnetic field rotates in a plane that includes thefirst direction, a magnetization fixed layer in which a magnetizationdirection is fixed relative to the external magnetic field, and a spacerlayer that is sandwiched between the magnetization free layer and themagnetization fixed layer and that has magnetoresistive effect.